class StoreSearchController < ApplicationController
	# 仅限搜索上海地区的，并且是激活和通过的商店
	def search
		# trim一下
		key_word = params[:key_word].strip
		unless key_word.empty?
			key_word = '%' + key_word + '%'
			@stores = Store.find(:all, :conditions => ["city = ? AND province = ? AND disabled = false AND passed = true AND (area like ? OR address like ? OR description like ?)", "上海", "上海", key_word, key_word, key_word])
		else
			flash[:notice] = "请输入搜索的内容"
			redirect_to :action => 'index'
		end
	end
	
	def index
		
	end
end
